3.23.84 \(\int \frac {-1+x}{(1+x) \sqrt {1+x+x^2}} \, dx\)

Optimal. Leaf size=35 \[ 2 \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {x^2+x+1}}\right )+\sinh ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {843, 619, 215, 724, 206} \begin {gather*} 2 \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {x^2+x+1}}\right )+\sinh ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-1 + x)/((1 + x)*Sqrt[1 + x + x^2]),x]

[Out]

ArcSinh[(1 + 2*x)/Sqrt[3]] + 2*ArcTanh[(1 - x)/(2*Sqrt[1 + x + x^2])]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 215

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[(Rt[b, 2]*x)/Sqrt[a]]/Rt[b, 2], x] /; FreeQ[{a, b},
 x] && GtQ[a, 0] && PosQ[b]

Rule 619

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[1/(2*c*((-4*c)/(b^2 - 4*a*c))^p), Subst[Int[Si
mp[1 - x^2/(b^2 - 4*a*c), x]^p, x], x, b + 2*c*x], x] /; FreeQ[{a, b, c, p}, x] && GtQ[4*a - b^2/c, 0]

Rule 724

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 843

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {-1+x}{(1+x) \sqrt {1+x+x^2}} \, dx &=-\left (2 \int \frac {1}{(1+x) \sqrt {1+x+x^2}} \, dx\right )+\int \frac {1}{\sqrt {1+x+x^2}} \, dx\\ &=4 \operatorname {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {1-x}{\sqrt {1+x+x^2}}\right )+\frac {\operatorname {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{3}}} \, dx,x,1+2 x\right )}{\sqrt {3}}\\ &=\sinh ^{-1}\left (\frac {1+2 x}{\sqrt {3}}\right )+2 \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {1+x+x^2}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 35, normalized size = 1.00 \begin {gather*} 2 \tanh ^{-1}\left (\frac {1-x}{2 \sqrt {x^2+x+1}}\right )+\sinh ^{-1}\left (\frac {2 x+1}{\sqrt {3}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-1 + x)/((1 + x)*Sqrt[1 + x + x^2]),x]

[Out]

ArcSinh[(1 + 2*x)/Sqrt[3]] + 2*ArcTanh[(1 - x)/(2*Sqrt[1 + x + x^2])]

________________________________________________________________________________________

IntegrateAlgebraic [A]  time = 0.24, size = 39, normalized size = 1.11 \begin {gather*} -\log \left (2 \sqrt {x^2+x+1}-2 x-1\right )-4 \tanh ^{-1}\left (-\sqrt {x^2+x+1}+x+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

IntegrateAlgebraic[(-1 + x)/((1 + x)*Sqrt[1 + x + x^2]),x]

[Out]

-4*ArcTanh[1 + x - Sqrt[1 + x + x^2]] - Log[-1 - 2*x + 2*Sqrt[1 + x + x^2]]

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 50, normalized size = 1.43 \begin {gather*} 2 \, \log \left (-x + \sqrt {x^{2} + x + 1}\right ) - 2 \, \log \left (-x + \sqrt {x^{2} + x + 1} - 2\right ) - \log \left (-2 \, x + 2 \, \sqrt {x^{2} + x + 1} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+x)/(1+x)/(x^2+x+1)^(1/2),x, algorithm="fricas")

[Out]

2*log(-x + sqrt(x^2 + x + 1)) - 2*log(-x + sqrt(x^2 + x + 1) - 2) - log(-2*x + 2*sqrt(x^2 + x + 1) - 1)

________________________________________________________________________________________

giac [A]  time = 0.18, size = 52, normalized size = 1.49 \begin {gather*} -\log \left (-2 \, x + 2 \, \sqrt {x^{2} + x + 1} - 1\right ) + 2 \, \log \left ({\left | -x + \sqrt {x^{2} + x + 1} \right |}\right ) - 2 \, \log \left ({\left | -x + \sqrt {x^{2} + x + 1} - 2 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+x)/(1+x)/(x^2+x+1)^(1/2),x, algorithm="giac")

[Out]

-log(-2*x + 2*sqrt(x^2 + x + 1) - 1) + 2*log(abs(-x + sqrt(x^2 + x + 1))) - 2*log(abs(-x + sqrt(x^2 + x + 1) -
 2))

________________________________________________________________________________________

maple [A]  time = 0.01, size = 32, normalized size = 0.91 \begin {gather*} \arcsinh \left (\frac {2 \sqrt {3}\, \left (x +\frac {1}{2}\right )}{3}\right )+2 \arctanh \left (\frac {-x +1}{2 \sqrt {-x +\left (x +1\right )^{2}}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-1+x)/(x+1)/(x^2+x+1)^(1/2),x)

[Out]

arcsinh(2/3*3^(1/2)*(x+1/2))+2*arctanh(1/2*(1-x)/((x+1)^2-x)^(1/2))

________________________________________________________________________________________

maxima [A]  time = 1.18, size = 41, normalized size = 1.17 \begin {gather*} \operatorname {arsinh}\left (\frac {2}{3} \, \sqrt {3} x + \frac {1}{3} \, \sqrt {3}\right ) - 2 \, \operatorname {arsinh}\left (\frac {\sqrt {3} x}{3 \, {\left | x + 1 \right |}} - \frac {\sqrt {3}}{3 \, {\left | x + 1 \right |}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+x)/(1+x)/(x^2+x+1)^(1/2),x, algorithm="maxima")

[Out]

arcsinh(2/3*sqrt(3)*x + 1/3*sqrt(3)) - 2*arcsinh(1/3*sqrt(3)*x/abs(x + 1) - 1/3*sqrt(3)/abs(x + 1))

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {x-1}{\left (x+1\right )\,\sqrt {x^2+x+1}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x - 1)/((x + 1)*(x + x^2 + 1)^(1/2)),x)

[Out]

int((x - 1)/((x + 1)*(x + x^2 + 1)^(1/2)), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x - 1}{\left (x + 1\right ) \sqrt {x^{2} + x + 1}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+x)/(1+x)/(x**2+x+1)**(1/2),x)

[Out]

Integral((x - 1)/((x + 1)*sqrt(x**2 + x + 1)), x)

________________________________________________________________________________________